#ifndef __SCHED_LOT_SC__
#define __SCHED_LOT_SC_

#include "basesched.h"

using namespace std;

typedef struct task_lotterySC {
  int pid;
  int tickets;
  bool block;
} task_lotterySC;

class SchedLotterySC : public SchedBase {
  public:
    SchedLotterySC(std::vector<int> argn);
    ~SchedLotterySC();
    virtual void load(int pid);
    virtual void load(int pid, int deadline);
    virtual void unblock(int pid);
    virtual int tick(int cpu, const enum Motivo m);
    
  private:

    std::vector< task_lotterySC > tasksInStandBy;
    int quantum;
    int remainder;

    int choseByDrawLottery(int cpu);
    int nextTask(int cpu);
    
    void removeTask(int pid);
    void setBlock(int pid, bool block);
    void block(int pid);
    
};

#endif
